package com.seas.dao;

import com.seas.domain.Person;
import com.seas.support.CustomRespository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created by Seas Cheng on 2017/9/25
 */
public interface PersonRepository extends CustomRespository<Person, Long> {
    List<Person> findByAddress(String address);
    Person findByNameAndAddress(String name, String address);
    @Query("select p from Person p where p.name=:name and p.address=:address")
    Person withNameAndAddressQuery(@Param("name") String name, @Param("address") String address);

//    Person withNameAndAddressNamedQuery(String name, String address);
}
